<template>
  <div class="pages">
    <el-pagination
      background
      @size-change="onPageSizeChange"
      @current-change="onPageChange"
      :current-page="pagenum"
      :total="total"
      :page-size="pagesize"
      :page-sizes="[5, 10, 20, 30]"
      layout="sizes, prev, pager, next, jumper,->,total"
    >
    </el-pagination>
  </div>
</template>
<script>
export default {
  name: 'PageTool',
  props: ['total', 'pagesize', 'pagenum'],
  data() {
    return {}
  },
  methods: {
    // 进入某一页
    onPageChange(pageNum) {
      this.$emit('pageChange', pageNum)
    },
    // 每页显示信息条数
    onPageSizeChange(pageSize) {
      this.$emit('pageSizeChange', pageSize)
    }
  }
}
</script>
<style scpoed>
.blue {
  color: #409eff;
}
</style>
